﻿<%@ Page Title="" Language="C#" MasterPageFile="~/default.master" AutoEventWireup="true" CodeFile="ShowModels.aspx.cs" Inherits="SchemaDB_ShowModels" %>

<%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderMain" Runat="Server">
    <h3>Manufacturer</h3>
    <p><span id="Manufacturer" runat="server" /></p>

    <h3>Top 5 Models*</h3>
        <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" 
            Font-Size="8pt" Height="400px" ShowToolBar="False" SizeToReportContent="True" 
            Width="670px">
            <LocalReport ReportPath="SchemaDB\ModelsTop5.rdlc">
                <DataSources>
                    <rsweb:ReportDataSource DataSourceId="ObjectDataSource1" 
                        Name="RouterControlDataSet_ModelsAboveAverageDW" />
                </DataSources>
            </LocalReport>
        </rsweb:ReportViewer>

    <h3>Top Models*,**</h3>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:GridView ID="GridView1" runat="server" AllowSorting="True" 
                    AutoGenerateColumns="False" DataSourceID="SqlDataSource1" Width="617px">
                    <Columns>
                        <asp:BoundField DataField="ModelName" HeaderText="Model" 
                            SortExpression="ModelName" />
                        <asp:BoundField DataField="SchemaCount" HeaderText="Count" 
                            SortExpression="SchemaCount" />
                    </Columns>
                </asp:GridView>
            </ContentTemplate>
        </asp:UpdatePanel>
        <p>* by total share on uploaded schemas<br />
        ** all models with a share above the average share of all uploaded schemas</p>

                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:RouterControlConnectionString %>" 
                    
                    
        SelectCommand="SELECT * FROM [ModelsAboveAverageDW] WHERE ([ManufacturerUrl] = @ManufacturerUrl) order by schemacount desc">
                    <SelectParameters>
                        <asp:QueryStringParameter Name="ManufacturerUrl" 
                            QueryStringField="ManufacturerUrl" Type="String" />
                    </SelectParameters>
                </asp:SqlDataSource>
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
        SelectMethod="GetDataBy" 
        
        TypeName="RouterControlDataSetTableAdapters.ModelsAboveAverageDWTableAdapter" 
        InsertMethod="Insert" OldValuesParameterFormatString="original_{0}">
            <SelectParameters>
                <asp:QueryStringParameter Name="ManufacturerUrl" 
                    QueryStringField="ManufacturerUrl" Type="String" />
            </SelectParameters>
            <InsertParameters>
                <asp:Parameter Name="Manufacturer" Type="String" />
                <asp:Parameter Name="ManufacturerUrl" Type="String" />
                <asp:Parameter Name="ModelName" Type="String" />
                <asp:Parameter Name="SchemaCount" Type="Int32" />
            </InsertParameters>
    </asp:ObjectDataSource>

    

</asp:Content>

